package com.woniuxy.tfss.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class Order {

    private Integer id;
    private Integer userId;
    private String no;//订单编号,后台统一产生
    private String orderTime;//用户下单的时间
    private String acceptTime;//接单时间(即时单与用户下单时间相同,预约单骑手抢单后赋值)
    private String getTime;//送达时间
    private String sendInfo;//寄件人信息
    private String recInfo;//收件人信息
    private BigDecimal totalMoney;//总金额,后台计算得出
    private BigDecimal realMoney;//实付金额,后台计算得出
    private BigDecimal distance;//距离,高德地图产生,前台传入
    private BigDecimal weight;//总重,后台计算得出
    private Integer riderId;//骑手id,预约单暂时为null
    private Integer discountId;//优惠券id,不使用优惠券时为0
    private String arrange;//订单预约的状态
    private String arrangeTime;//预约单的预约时间,可为null
    private Integer expectTime;//预计送达时间,高德地图产生
    private String payType;//支付方式
    private String status;

    //骑手收益为，及时订单为订单金额的30%，预约单为订单金额的40%，超时订单直接不给予收益
    //有赔付的单子，选择赔付方案1的，及时订单为订单金额的20%，预约订单为订单金额的30%
    //有赔付的单子，选择赔付方案2的，及时订单为订单金额的10%，预约订单为订单金额的20%

    //用来进行表单提交的废物字段,自动无视即可
    @TableField(exist = false)
    private String sendAddress;
    @TableField(exist = false)
    private String sendName;
    @TableField(exist = false)
    private String sendPhone;
    @TableField(exist = false)
    private String recAddress;
    @TableField(exist = false)
    private String recName;
    @TableField(exist = false)
    private String recPhone;
    @TableField(exist = false)
    private String riderPhone;


    @TableField(exist = false)
    private List<Item> items;//用于存订单详情的字段,不需要放在数据库中

    public static final String USERMONEY = "1";//支付方式,余额支付
    public static final String ALIPAY = "2";//支付方式,支付宝

    public static final String ISARRANGE = "1";//订单预约状态,预约单
    public static final String NOTARRANGE = "2";//订单预约状态,即时单

    public static final String WAIT = "1";//订单状态,待分配(预约单)
    public static final String RIDING = "2";//订单状态,配送中
    public static final String OVERTIME = "3";//订单状态,已超时
    public static final String RECEIVED = "4";//订单状态,已送达(待评价)
    public static final String REMARKED = "5";//订单状态,已完成(已评价)
    public static final String DELETED = "6";//订单状态,已删除(用户逻辑删除)
    public static final String WAITCONFIRM = "7";//订单状态,待确认
    public static final String NEEDEXAMINE = "8";//订单状态,待审核
    //public static final String CLAIMED="9";//订单状态,已经赔偿
    public static final String NOTPAYCANCEL = "10";//订单状态,已取消(未付款)
    public static final String NORIDERCANCEL = "11";//订单状态,已取消(无骑手抢单)
    public static final String WAITTAKE = "12";//待取件
    public static final String CANCEL = "13";//已取消


    public static final String PLAN1 = "14";//赔付方案1，赔付50%,待评价
    public static final String PLAN2 = "15";//赔付方案2，赔付100%，待评价
    public static final String REMARKEDPAY1 = "16";//已完成（赔付50%，已评价）
    public static final String REMARKEDPAY2 = "17";//已完成（赔付100%，已评价）


}
